<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libschc: fragmenter.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libschc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">fragmenter.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="schc_8h_source.html">schc.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="schc__config_8h_source.html">schc_config.h</a>&quot;</code><br />
</div>
<p><a href="fragmenter_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structschc__fragmentation__ack__t.html">schc_fragmentation_ack_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ab014037ee9ccea0cea6b2d5366dee902"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#ab014037ee9ccea0cea6b2d5366dee902">SCHC_FRAG_INPUT</a>&#160;&#160;&#160;2</td></tr>
<tr class="memdesc:ab014037ee9ccea0cea6b2d5366dee902"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code: Indicator.  <a href="fragmenter_8h.html#ab014037ee9ccea0cea6b2d5366dee902">More...</a><br /></td></tr>
<tr class="separator:ab014037ee9ccea0cea6b2d5366dee902"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ae988f716a3d42117f0777a56f8f1c3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a4ae988f716a3d42117f0777a56f8f1c3">SCHC_ACK_INPUT</a>&#160;&#160;&#160;1</td></tr>
<tr class="memdesc:a4ae988f716a3d42117f0777a56f8f1c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code: Indicator.  <a href="fragmenter_8h.html#a4ae988f716a3d42117f0777a56f8f1c3">More...</a><br /></td></tr>
<tr class="separator:a4ae988f716a3d42117f0777a56f8f1c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a609c4c5b7a6cdc56c3b1fc47c2cac402"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a609c4c5b7a6cdc56c3b1fc47c2cac402">SCHC_SUCCESS</a>&#160;&#160;&#160;0</td></tr>
<tr class="memdesc:a609c4c5b7a6cdc56c3b1fc47c2cac402"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code: No error.  <a href="fragmenter_8h.html#a609c4c5b7a6cdc56c3b1fc47c2cac402">More...</a><br /></td></tr>
<tr class="separator:a609c4c5b7a6cdc56c3b1fc47c2cac402"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f937d9fe4a9fb1d4fa406cde779fffd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a8f937d9fe4a9fb1d4fa406cde779fffd">SCHC_END</a>&#160;&#160;&#160;3</td></tr>
<tr class="memdesc:a8f937d9fe4a9fb1d4fa406cde779fffd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code: End of fragmentation cycle.  <a href="fragmenter_8h.html#a8f937d9fe4a9fb1d4fa406cde779fffd">More...</a><br /></td></tr>
<tr class="separator:a8f937d9fe4a9fb1d4fa406cde779fffd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72455d89c3af7b0868fbaf7095e5af11"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a72455d89c3af7b0868fbaf7095e5af11">SCHC_FAILURE</a>&#160;&#160;&#160;-1</td></tr>
<tr class="memdesc:a72455d89c3af7b0868fbaf7095e5af11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code: Error.  <a href="fragmenter_8h.html#a72455d89c3af7b0868fbaf7095e5af11">More...</a><br /></td></tr>
<tr class="separator:a72455d89c3af7b0868fbaf7095e5af11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a702d10e122e8809285882b69ae2e69a1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a702d10e122e8809285882b69ae2e69a1">SCHC_NO_FRAGMENTATION</a>&#160;&#160;&#160;-2</td></tr>
<tr class="memdesc:a702d10e122e8809285882b69ae2e69a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code: Error.  <a href="fragmenter_8h.html#a702d10e122e8809285882b69ae2e69a1">More...</a><br /></td></tr>
<tr class="separator:a702d10e122e8809285882b69ae2e69a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a8e32bf67127c30c23e08e9974f02c5f0"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a8e32bf67127c30c23e08e9974f02c5f0">schc_mbuf_t</a></td></tr>
<tr class="separator:a8e32bf67127c30c23e08e9974f02c5f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71d11b7d40657f1abe84aeed57a22b43"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structschc__fragmentation__ack__t.html">schc_fragmentation_ack_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a71d11b7d40657f1abe84aeed57a22b43">schc_fragmentation_ack_t</a></td></tr>
<tr class="separator:a71d11b7d40657f1abe84aeed57a22b43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a250ace05899a868a846b1bdaaa30288b"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a250ace05899a868a846b1bdaaa30288b">schc_fragmentation_t</a></td></tr>
<tr class="separator:a250ace05899a868a846b1bdaaa30288b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a38ccd754938e6c276447dff49f5a3a34"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34">tx_state</a> { <br />
&#160;&#160;<a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34a8131166fb07d0aa1155e334e90b63d2d">INIT_TX</a> = 0, 
<a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34a67be7a5f47004345047b32fff72a2230">SEND</a> = 1, 
<a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34ad8c334cdd607abfeba91555c1b63cd5a">RESEND</a> = 2, 
<a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34a6736812226bab580f621c5e1de53d861">WAIT_BITMAP</a> = 3, 
<br />
&#160;&#160;<a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34a8dedf42db360ffa63832fa48fb9ddeee">END_TX</a> = 4, 
<a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34a0f886785b600b91048fcdc434c6b4a8e">ERR</a> = 5
<br />
 }</td></tr>
<tr class="separator:a38ccd754938e6c276447dff49f5a3a34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20874253e23bc4c1d20f69479175ce6f"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6f">rx_state</a> { <br />
&#160;&#160;<a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6fa6fea2421f5cc1e8bc1ecebd848139362">RECV_WINDOW</a> = 0, 
<a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6fa9a3cdfd5436e5486043ccdd4e8549dcf">WAIT_NEXT_WINDOW</a> = 1, 
<a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6fa84114eb766ef9186899ff21358c0b416">WAIT_MISSING_FRAG</a> = 2, 
<a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6fab39d14dff9148f467ef7a253b80b40bd">WAIT_END</a> = 3, 
<br />
&#160;&#160;<a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6fa204deb4800b60b28307aa8a00a85ee36">END_RX</a> = 4, 
<a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6fa781ad2788df9e25c59a70894c7832096">ABORT</a> = 5
<br />
 }</td></tr>
<tr class="separator:a20874253e23bc4c1d20f69479175ce6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:adaabb8a36ff87d9f89d8215b2773c6c7"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#adaabb8a36ff87d9f89d8215b2773c6c7">schc_fragmenter_init</a> (<a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *tx_conn, uint8_t(*send)(uint8_t *data, uint16_t length, uint32_t device_id), void(*end_rx)(<a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *conn), void(*remove_timer_entry)(uint32_t device_id))</td></tr>
<tr class="memdesc:adaabb8a36ff87d9f89d8215b2773c6c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the SCHC fragmenter.  <a href="fragmenter_8h.html#adaabb8a36ff87d9f89d8215b2773c6c7">More...</a><br /></td></tr>
<tr class="separator:adaabb8a36ff87d9f89d8215b2773c6c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c375e7b44652a0eccb9248083a6251d"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a5c375e7b44652a0eccb9248083a6251d">schc_fragment</a> (<a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *tx_conn)</td></tr>
<tr class="memdesc:a5c375e7b44652a0eccb9248083a6251d"><td class="mdescLeft">&#160;</td><td class="mdescRight">the sender state machine  <a href="fragmenter_8h.html#a5c375e7b44652a0eccb9248083a6251d">More...</a><br /></td></tr>
<tr class="separator:a5c375e7b44652a0eccb9248083a6251d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a248f74b7a8b0ef5f7dbc3f418e05a8"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a6a248f74b7a8b0ef5f7dbc3f418e05a8">schc_reassemble</a> (<a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *rx_conn)</td></tr>
<tr class="memdesc:a6a248f74b7a8b0ef5f7dbc3f418e05a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">the receiver state machine  <a href="fragmenter_8h.html#a6a248f74b7a8b0ef5f7dbc3f418e05a8">More...</a><br /></td></tr>
<tr class="separator:a6a248f74b7a8b0ef5f7dbc3f418e05a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af04b125eaaa72e66f782bdb592133a27"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#af04b125eaaa72e66f782bdb592133a27">schc_reset</a> (<a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *conn)</td></tr>
<tr class="memdesc:af04b125eaaa72e66f782bdb592133a27"><td class="mdescLeft">&#160;</td><td class="mdescRight">reset a connection  <a href="fragmenter_8h.html#af04b125eaaa72e66f782bdb592133a27">More...</a><br /></td></tr>
<tr class="separator:af04b125eaaa72e66f782bdb592133a27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a555170940dd8eb3a6b64405f28e4655f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a555170940dd8eb3a6b64405f28e4655f">schc_input</a> (uint8_t *data, uint16_t len, <a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *rx_conn, uint32_t device_id)</td></tr>
<tr class="memdesc:a555170940dd8eb3a6b64405f28e4655f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function should be called whenever a packet is received.  <a href="fragmenter_8h.html#a555170940dd8eb3a6b64405f28e4655f">More...</a><br /></td></tr>
<tr class="separator:a555170940dd8eb3a6b64405f28e4655f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb5688d5a6d4d0f4f955951b6ee130b1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#abb5688d5a6d4d0f4f955951b6ee130b1">schc_ack_input</a> (uint8_t *data, uint16_t len, <a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *tx_conn, uint32_t device_id)</td></tr>
<tr class="memdesc:abb5688d5a6d4d0f4f955951b6ee130b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function should be called whenever an ack is received.  <a href="fragmenter_8h.html#abb5688d5a6d4d0f4f955951b6ee130b1">More...</a><br /></td></tr>
<tr class="separator:abb5688d5a6d4d0f4f955951b6ee130b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4be088b297563aa42398b23d40868b37"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a4be088b297563aa42398b23d40868b37">schc_fragment_input</a> (uint8_t *data, uint16_t len, uint32_t device_id)</td></tr>
<tr class="memdesc:a4be088b297563aa42398b23d40868b37"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function should be called whenever a fragment is received an open connection is picked for the device out of a pool of connections to keep track of the packet.  <a href="fragmenter_8h.html#a4be088b297563aa42398b23d40868b37">More...</a><br /></td></tr>
<tr class="separator:a4be088b297563aa42398b23d40868b37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1b728ad496229979c1eea633a13076d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#ab1b728ad496229979c1eea633a13076d">schc_get_connection</a> (uint32_t device_id)</td></tr>
<tr class="memdesc:ab1b728ad496229979c1eea633a13076d"><td class="mdescLeft">&#160;</td><td class="mdescRight">find a connection based on a device id or open a new connection if there was no connection for this device yet  <a href="fragmenter_8h.html#ab1b728ad496229979c1eea633a13076d">More...</a><br /></td></tr>
<tr class="separator:ab1b728ad496229979c1eea633a13076d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a974581b10381381bafe401fc2ddc54c7"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a974581b10381381bafe401fc2ddc54c7">get_mbuf_len</a> (<a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a> *head)</td></tr>
<tr class="memdesc:a974581b10381381bafe401fc2ddc54c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the total length of the mbuf  <a href="fragmenter_8h.html#a974581b10381381bafe401fc2ddc54c7">More...</a><br /></td></tr>
<tr class="separator:a974581b10381381bafe401fc2ddc54c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b3e7a45b2ff0f407adfcc266f47c3dc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fragmenter_8h.html#a3b3e7a45b2ff0f407adfcc266f47c3dc">mbuf_copy</a> (<a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a> *head, uint8_t *ptr)</td></tr>
<tr class="memdesc:a3b3e7a45b2ff0f407adfcc266f47c3dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">copy the byte alligned contents of the mbuf chain to the passed pointer  <a href="fragmenter_8h.html#a3b3e7a45b2ff0f407adfcc266f47c3dc">More...</a><br /></td></tr>
<tr class="separator:a3b3e7a45b2ff0f407adfcc266f47c3dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a4ae988f716a3d42117f0777a56f8f1c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ae988f716a3d42117f0777a56f8f1c3">&#9670;&nbsp;</a></span>SCHC_ACK_INPUT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCHC_ACK_INPUT&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return code: Indicator. </p>
<p>Generic indication that an acknowledgment was received </p>

</div>
</div>
<a id="a8f937d9fe4a9fb1d4fa406cde779fffd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f937d9fe4a9fb1d4fa406cde779fffd">&#9670;&nbsp;</a></span>SCHC_END</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCHC_END&#160;&#160;&#160;3</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return code: End of fragmentation cycle. </p>
<p>Indicates successful completion of an SCHC fragmentation cycle. </p>

</div>
</div>
<a id="a72455d89c3af7b0868fbaf7095e5af11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a72455d89c3af7b0868fbaf7095e5af11">&#9670;&nbsp;</a></span>SCHC_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCHC_FAILURE&#160;&#160;&#160;-1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return code: Error. </p>
<p>Generic indication that an SCHC operation went wrong </p>

</div>
</div>
<a id="ab014037ee9ccea0cea6b2d5366dee902"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab014037ee9ccea0cea6b2d5366dee902">&#9670;&nbsp;</a></span>SCHC_FRAG_INPUT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCHC_FRAG_INPUT&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return code: Indicator. </p>
<p>Generic indication that a fragment was received </p>

</div>
</div>
<a id="a702d10e122e8809285882b69ae2e69a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a702d10e122e8809285882b69ae2e69a1">&#9670;&nbsp;</a></span>SCHC_NO_FRAGMENTATION</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCHC_NO_FRAGMENTATION&#160;&#160;&#160;-2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return code: Error. </p>
<p>Generic indication that no fragmentation was needed </p>

</div>
</div>
<a id="a609c4c5b7a6cdc56c3b1fc47c2cac402"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a609c4c5b7a6cdc56c3b1fc47c2cac402">&#9670;&nbsp;</a></span>SCHC_SUCCESS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCHC_SUCCESS&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return code: No error. </p>
<p>Indicates successful completion of an SCHC operation. </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a71d11b7d40657f1abe84aeed57a22b43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71d11b7d40657f1abe84aeed57a22b43">&#9670;&nbsp;</a></span>schc_fragmentation_ack_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structschc__fragmentation__ack__t.html">schc_fragmentation_ack_t</a> <a class="el" href="structschc__fragmentation__ack__t.html">schc_fragmentation_ack_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a250ace05899a868a846b1bdaaa30288b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a250ace05899a868a846b1bdaaa30288b">&#9670;&nbsp;</a></span>schc_fragmentation_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> <a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a8e32bf67127c30c23e08e9974f02c5f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e32bf67127c30c23e08e9974f02c5f0">&#9670;&nbsp;</a></span>schc_mbuf_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a> <a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a20874253e23bc4c1d20f69479175ce6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20874253e23bc4c1d20f69479175ce6f">&#9670;&nbsp;</a></span>rx_state</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="fragmenter_8h.html#a20874253e23bc4c1d20f69479175ce6f">rx_state</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a20874253e23bc4c1d20f69479175ce6fa6fea2421f5cc1e8bc1ecebd848139362"></a>RECV_WINDOW&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a20874253e23bc4c1d20f69479175ce6fa9a3cdfd5436e5486043ccdd4e8549dcf"></a>WAIT_NEXT_WINDOW&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a20874253e23bc4c1d20f69479175ce6fa84114eb766ef9186899ff21358c0b416"></a>WAIT_MISSING_FRAG&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a20874253e23bc4c1d20f69479175ce6fab39d14dff9148f467ef7a253b80b40bd"></a>WAIT_END&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a20874253e23bc4c1d20f69479175ce6fa204deb4800b60b28307aa8a00a85ee36"></a>END_RX&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a20874253e23bc4c1d20f69479175ce6fa781ad2788df9e25c59a70894c7832096"></a>ABORT&#160;</td><td class="fielddoc"></td></tr>
</table>

</div>
</div>
<a id="a38ccd754938e6c276447dff49f5a3a34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38ccd754938e6c276447dff49f5a3a34">&#9670;&nbsp;</a></span>tx_state</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="fragmenter_8h.html#a38ccd754938e6c276447dff49f5a3a34">tx_state</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a38ccd754938e6c276447dff49f5a3a34a8131166fb07d0aa1155e334e90b63d2d"></a>INIT_TX&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a38ccd754938e6c276447dff49f5a3a34a67be7a5f47004345047b32fff72a2230"></a>SEND&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a38ccd754938e6c276447dff49f5a3a34ad8c334cdd607abfeba91555c1b63cd5a"></a>RESEND&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a38ccd754938e6c276447dff49f5a3a34a6736812226bab580f621c5e1de53d861"></a>WAIT_BITMAP&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a38ccd754938e6c276447dff49f5a3a34a8dedf42db360ffa63832fa48fb9ddeee"></a>END_TX&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a38ccd754938e6c276447dff49f5a3a34a0f886785b600b91048fcdc434c6b4a8e"></a>ERR&#160;</td><td class="fielddoc"></td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a974581b10381381bafe401fc2ddc54c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a974581b10381381bafe401fc2ddc54c7">&#9670;&nbsp;</a></span>get_mbuf_len()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t get_mbuf_len </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a> *&#160;</td>
          <td class="paramname"><em>head</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>returns the total length of the mbuf </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">head</td><td>the head of the list</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>len the total length of the fragment </dd></dl>

</div>
</div>
<a id="a3b3e7a45b2ff0f407adfcc266f47c3dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b3e7a45b2ff0f407adfcc266f47c3dc">&#9670;&nbsp;</a></span>mbuf_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mbuf_copy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__mbuf__t.html">schc_mbuf_t</a> *&#160;</td>
          <td class="paramname"><em>head</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>copy the byte alligned contents of the mbuf chain to the passed pointer </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">head</td><td>the head of the list </td></tr>
    <tr><td class="paramname">ptr</td><td>the pointer to copy the contents to </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="abb5688d5a6d4d0f4f955951b6ee130b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb5688d5a6d4d0f4f955951b6ee130b1">&#9670;&nbsp;</a></span>schc_ack_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void schc_ack_input </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td>
          <td class="paramname"><em>tx_conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>device_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function should be called whenever an ack is received. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>a pointer to the received data </td></tr>
    <tr><td class="paramname">len</td><td>the length of the received packet </td></tr>
    <tr><td class="paramname">tx_conn</td><td>a pointer to the tx initialization structure </td></tr>
    <tr><td class="paramname">device_id</td><td>the device id from the rx source </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5c375e7b44652a0eccb9248083a6251d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c375e7b44652a0eccb9248083a6251d">&#9670;&nbsp;</a></span>schc_fragment()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t schc_fragment </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td>
          <td class="paramname"><em>tx_conn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the sender state machine </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tx_conn</td><td>a pointer to the tx connection structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 TBD -1 failed to initialize the connection -2 no fragmentation was needed for this packet </dd></dl>

</div>
</div>
<a id="a4be088b297563aa42398b23d40868b37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4be088b297563aa42398b23d40868b37">&#9670;&nbsp;</a></span>schc_fragment_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a>* schc_fragment_input </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>device_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function should be called whenever a fragment is received an open connection is picked for the device out of a pool of connections to keep track of the packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>a pointer to the data packet </td></tr>
    <tr><td class="paramname">len</td><td>the length of the received packet </td></tr>
    <tr><td class="paramname">device_id</td><td>the device id from the rx source</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>conn the connection </dd></dl>

</div>
</div>
<a id="adaabb8a36ff87d9f89d8215b2773c6c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adaabb8a36ff87d9f89d8215b2773c6c7">&#9670;&nbsp;</a></span>schc_fragmenter_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t schc_fragmenter_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td>
          <td class="paramname"><em>tx_conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t(*)(uint8_t *data, uint16_t length, uint32_t device_id)&#160;</td>
          <td class="paramname"><em>send</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(<a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *conn)&#160;</td>
          <td class="paramname"><em>end_rx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(uint32_t device_id)&#160;</td>
          <td class="paramname"><em>remove_timer_entry</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the SCHC fragmenter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tx_conn</td><td>a pointer to the tx initialization structure </td></tr>
    <tr><td class="paramname">send</td><td>a pointer to the send callback </td></tr>
    <tr><td class="paramname">end_rx</td><td>this function is called to indicate that the last rx timer has expired </td></tr>
    <tr><td class="paramname">remove_timer_entry</td><td>some scheduler implementations need a callback to remove a timer entry for a certain device</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>error codes on error </dd></dl>

</div>
</div>
<a id="ab1b728ad496229979c1eea633a13076d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1b728ad496229979c1eea633a13076d">&#9670;&nbsp;</a></span>schc_get_connection()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a>* schc_get_connection </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>device_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>find a connection based on a device id or open a new connection if there was no connection for this device yet </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device_id</td><td>the id of the device to open a connection for</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>conn a pointer to the selected connection 0 if no free connections are available </dd></dl>

</div>
</div>
<a id="a555170940dd8eb3a6b64405f28e4655f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a555170940dd8eb3a6b64405f28e4655f">&#9670;&nbsp;</a></span>schc_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a>* schc_input </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td>
          <td class="paramname"><em>tx_conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>device_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function should be called whenever a packet is received. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>a pointer to the received data </td></tr>
    <tr><td class="paramname">len</td><td>the length of the received packet </td></tr>
    <tr><td class="paramname">tx_conn</td><td>a pointer to the tx initialization structure </td></tr>
    <tr><td class="paramname">device_id</td><td>the device id from the rx source </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6a248f74b7a8b0ef5f7dbc3f418e05a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a248f74b7a8b0ef5f7dbc3f418e05a8">&#9670;&nbsp;</a></span>schc_reassemble()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t schc_reassemble </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td>
          <td class="paramname"><em>rx_conn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the receiver state machine </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">conn</td><td>a pointer to the connection</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 TBD </dd></dl>

</div>
</div>
<a id="af04b125eaaa72e66f782bdb592133a27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af04b125eaaa72e66f782bdb592133a27">&#9670;&nbsp;</a></span>schc_reset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void schc_reset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__fragmentation__t.html">schc_fragmentation_t</a> *&#160;</td>
          <td class="paramname"><em>conn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>reset a connection </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">conn</td><td>a pointer to the connection to reset </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
